package com;

/**
 * Description: 测试jmm的原子性，和volatile ,volatile可以让其读取主内存 而不是单个内存
 *
 * @Autor: Rolin
 * datetime: 09-10-11:20
 */
public class JucTest {

    volatile static boolean a = true ;

    public static void main(String[] args) throws InterruptedException {
      Thread t =  new Thread(()->{
           while (a){
               System.out.println(1);
           }
       });
      t.start();
      t.sleep(1000);
      a = false ;
    }
}
